import { GET } from '../../request';
import { Res } from '../../common';

/**
 * 获取首页产品列表
 * @returns
 */
export const getHomeProductList = (params: any): Promise<Res<any>> => {
  return GET('/api/store_goods_list', { ...params });
};

/**
 * 获取首页滚动活动数据
 * @param params
 * @returns
 */
export const getHomeTopicList = (): Promise<Res<any>> => {
  return GET('/api/topic_list_index');
};

/**
 * 获取首页滚动活动数据
 * @param params
 * @returns
 */
export const getActivityList = (): Promise<Res<any>> => {
  return GET('/api/topic_list');
};

/**
 * 获取首页banner列表
 * @param params
 * @returns
 */
export const getHomeBanners = (): Promise<Res<any>> => {
  return GET('/api/banner_list');
};

/**
 * 获取首页弹框列表
 * @param params
 * @returns
 */
export const getHomePopups = (): Promise<Res<any>> => {
  return GET('/api/pop_list');
};

/**
 * 广告点击率
 */
export const sendClickData = (params: any): Promise<Res<any>> => {
  return GET('/api/ad_rate', params);
};

/**
 * 首页4个秒杀商品
 */
export const getMiaoshaList = (): Promise<Res<any>> => {
  return GET('/api/seckill_list_index');
};

/**
 * 日期秒杀列表
 */
export const getMidaoshaDates = (params: any) => {
  return GET('/api/seckill_list', params);
};

/**
 * 秒杀详情
 */
export const getMiaoshaDetail = (params: any) => {
  return GET('/api/detail_seckill', params);
};

/**
 * 搜索top10
 */
export const getSearchTop10 = (params: any) => {
  return GET('/api/search_top_list', params);
};

/**
 * 搜索商品或者服务
 */
export const getSearchData = (params: any) => {
  return GET('/api/search', params);
};
